drop table jms_dm.dm_tab_center_weight_rate_net_summary_dt --循环袋建包明细;
CREATE TABLE jms_dm.dm_tab_center_weight_rate_net_summary_dt
(
    no_weigh_qty1     bigint comment '单件未称重票数',
    no_weigh_qty2     bigint comment '包件应称重包数',
    site_code         varchar(100) comment '中心到件扫描的网点code',
    proxy_area_code   varchar(100) comment '代理区',
    site_name         varchar(100) comment '中心到件扫描的网点名称',
    proxy_area_name   varchar(100) comment '代理区',
    should_weigh_qty1 bigint comment '单件应称重票数',
    qty1_rate         decimal(16,2) comment '单件称重率',
    should_weigh_qty2 bigint comment '包件应称重包数',
    qty2_rate         decimal(16,2) comment '包件应称重包数',
    less_three_qty    bigint comment '不足3kg包数',
    weigh_rate        decimal(16,2) comment '综合称重率',
    date_time         date comment '日期'
) ENGINE = OLAP DUPLICATE KEY( no_weigh_qty1,no_weigh_qty2,site_code, proxy_area_code)
COMMENT "中心出港称重率报表汇总"
PARTITION BY RANGE(date_time)
(START ("2022-06-01") END ("2022-07-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(`site_code`) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);

